package test00.test05.t01.demo03;
import test00.test05.t01.Student;
import java.util.Arrays;
import java.util.function.Supplier;

/**
 * @Author lzp
 * @Date 2024-04-10
 */
public class Test {

    public static void main(String[] args) {

        Student[] stu ={
                new Student("张三",10),
                new Student("李四",20),
                new Student("王五",30)
        };
        Supplier<Student> supplier = ()->{
            Arrays.sort(stu, (stu1, stu2) -> stu2.getAge() - stu1.getAge());
            return stu[stu.length - 1];
        };

        System.out.println(supplier.get());

    }

}
